import 'dart:io';

import 'package:flutter/material.dart';

void main() {
  runApp(new StepperPlugin());
}

/*
 * 步骤条组件  <br/>
 * 需要传入的键：<br/>
 * 传入的值类型： <br/>
 * 传入的值含义：<br/>
 * 是否必传 ：
 */
class StepperPlugin extends StatefulWidget {
  State<StatefulWidget> createState() {
    return new StepperPluginState();
  }
}

/*
 * 页面功能 <br/>
 */
class StepperPluginState extends State<StatefulWidget> {
  Widget build(BuildContext context) {
    AppBar appBar = AppBar(
      leading: new IconButton(
        icon: new Icon(Icons.arrow_back),
        onPressed: () {},
      ),
      title: new Text('FlutterDesign'),
      centerTitle: true,
      actions: <Widget>[
        new Container(width: 0, height: 0),
        new Container(width: 0, height: 0),
      ],
      backgroundColor: Colors.blue,
    );

    return MaterialApp(
      home: new Scaffold(
        appBar: appBar,
        body: new Builder(builder: (BuildContext context) {
          return Stepper(
            currentStep: 2, // <-- 激活的下标
            steps: <Step>[
              new Step(
                title: GestureDetector(
                  onTap: () {
                    print('3434');
                  },
                  child: new Text('第一步'),
                ),
                content: new Text('第一步内容'),
                state: StepState.complete,
                isActive: true,
                subtitle: new Text('第一步小标题'),
              ),
              new Step(
                title: new Text('第二步'),
                content: new Text('第二步内容'),
              ),
              new Step(
                title: new Text('第三步'),
                content: new Text('第三步内容'),
              ),
            ],
          );
        }),
        backgroundColor: Colors.white,
        bottomNavigationBar: null,
      ),
    );
  }

  Widget buildOld(BuildContext context) {
    AppBar appBar = AppBar(
      leading: new IconButton(
        icon: new Icon(Icons.arrow_back),
        onPressed: () {},
      ),
      title: new Text('FlutterDesign'),
      centerTitle: true,
      actions: <Widget>[
        new Container(width: 0, height: 0),
        new Container(width: 0, height: 0),
      ],
      backgroundColor: Colors.blue,
    );

    return MaterialApp(
      home: new Scaffold(
        appBar: appBar,
        body: new Builder(builder: (BuildContext context) {
          return Material(
            child: Ink(
              child:
              InkWell(
                onTap: () {
                  print('3434');
                },
                child: Container(
                  height: 50.0,
                  color: Colors.white,
                  child: Text( "是速度",
                    maxLines: 1,
                    style: TextStyle(color: Colors.red),
                    overflow: TextOverflow.ellipsis,
                  ),
                ),
              ),
            ),
          );
        }),
        backgroundColor: Colors.white,
        bottomNavigationBar: null,
      ),
    );
  }
}
